package cn.initcap.designpattern.pattern.behavioral.state;

/**
 * 状态模式
 *
 * @author initcap
 * @date Created in 2018/11/1 PM11:49.
 */
public class Test {

    public static void main(String[] args) {
        CourseVideoContext courseVideoContext = new CourseVideoContext();
        courseVideoContext.setBaseCourseVideoState(new PlayStateBase());

        System.out.println("当前状态:" + courseVideoContext.getBaseCourseVideoState().getClass().getSimpleName());

        courseVideoContext.pause();
        System.out.println("当前状态:" + courseVideoContext.getBaseCourseVideoState().getClass().getSimpleName());

        courseVideoContext.speed();
        System.out.println("当前状态:" + courseVideoContext.getBaseCourseVideoState().getClass().getSimpleName());

        courseVideoContext.stop();
        System.out.println("当前状态:" + courseVideoContext.getBaseCourseVideoState().getClass().getSimpleName());

        courseVideoContext.speed();
        System.out.println("当前状态:" + courseVideoContext.getBaseCourseVideoState().getClass().getSimpleName());
    }

}
